﻿@using ZhouYu.DreamTour.Model;
@using ZhouYu.DreamTour.Web.Models;
@{
    var user = ViewBag.user as UserInfo;
    var tourVo = ViewBag.tourVo as List<TouristVolInfo>;
    var UserInfo = UserInfoContext.userInfoContext.UserInfo;
}
<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>中国梦想游-会员登录页</title>
    <link href="~/css/style.css" rel="stylesheet" type="text/css" />
    <link href="~/css/common.css" rel="stylesheet" type="text/css" />
    <link href="~/layui-v2.5.4/layui/css/layui.css" rel="stylesheet" type="text/css" />
    <link href="~/layui-v2.5.4/layui/css/modules/layer/default/layer.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="~/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="~/layui-v2.5.4/layui/layui.js"></script>
    <script type="text/javascript" src="~/layui-v2.5.4/layui/lay/modules/layer.js"></script>
</head>
<body>
    <div class="top_hw clearfix">
        <div class="top_h clearfix">
            <div class="top_hl"><span>欢迎来到中国梦想游，让你的梦想全程免费自由行！</span> 预定热线：<b>0571-63322269</b></div>
            <div class="top_hr">
                @if (UserInfo == null)
                {
                    <a href="/Home/User_Register">会员注册</a>
                    <span>|</span> <a href="/Home/User_Login">登录</a>
                    <span>|</span> <a href="#">梦想收藏</a> <span>|</span> <a href="#">设为首页</a>
                    @*<a>
                欢迎你，来到新世界旅行网！
            </a>*@
                }
                else
                {
                    <a href="/Home/User_Center">会员中心</a>
                    <span>|</span> <a href="#">梦想收藏</a> <span>|</span> <a href="#">设为首页</a> <span>|</span> <a href="/Login/LoginOut">退出</a> <span>|</span>
                    <a>
                        欢迎你，<span>@UserInfo.User_Name</span>来到新世界旅行网！
                    </a>
                }
            </div>
        </div>
    </div>
    <div class="head_w">
        <div class="head_t clearfix">
            <div class="logo"><img src="~/images/logo.jpg"></div>
            <div class="rx_line"><img src="~/images/rx.jpg"></div>
        </div>
    </div>
    <div class="mainNav clearfix">
        <ul class="Nav_ul">
            <li><a href="/Home/Index">首页</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Route">旅游路线</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Scenic">旅游景点</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/CateringAccommodation">餐饮住宿</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Traffic_DatailsOne">交通线路</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Group">旅游团购</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Specialty">地方特产</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/AutoGenerationIntro">自动生成简介</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Team_Join">团队简介</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Itinerary_Details">行程导航</a></li>
        </ul>
    </div>
    <div class="b_wrap">
        <div class="current"><span>当前所在地：</span><a href="/Home/Index">首页</a> >> <a href="/Home/User_Center">会员中心</a></div>
        <div class="fmember">
            <div class="fmleft">
                <div class="fmleft_top"><img src="~/images/fmbt1.png" border="0"></div>
                <div class="fmlist">
                    <ul>
                        <li class="f1">订单中心</li>
                        <li> >><a href="/Home/User_Order">我的订单</a> </li>
                        <li> >><a href="/Home/User_Colleague">发布结伴同行</a> </li>
                        <li> >><a href="/Home/User_Apply">我申请的结伴同行</a> </li>
                        <li> >><a href="/Home/User_Comment">我的点评</a> </li>
                        <li class="f2"> >><a href="/Home/User_Questions">我的提问</a> </li>
                    </ul>
                    <ul>
                        <li class="f1">我的优惠卡券</li>
                        <li> >><a href="/Home/User_CashAccount">现金账号</a> </li>
                        <li> >><a href="/Home/User_AllowanceVol">抵用券</a> </li>
                        <li class="f2"> >><a href="/Home/User_TouristVol">旅游券</a> </li>
                    </ul>
                    <ul>
                        <li class="f1">账户信息</li>
                        <li> >><a href="/Home/User_Data">个人资料</a> </li>
                        <li> >><a href="/Home/User_AccountSecurity">账户安全</a> </li>
                        <li>
                            >>
                            <a href="/Home/User_Bank">我的银行卡</a>
                        </li>
                        <li> >><a href="/Home/User_Integral">我的积分</a> </li>
                        <li> >><a href="/Home/User_UpdatePwd">修改密码</a> </li>
                        <li class="f2"> >><a href="/Home/User_Address">配送地址</a> </li>
                    </ul>
                </div>
            </div>
            <div class="fmright">
                <div class="fmr1">
                    <div class="fmr1_top">旅游券</div>
                    <div class="fmr1_m">
                        <div class="fcard">
                            旅游券余额：<span class="fspan5">@user.User_TravelVoCount</span>
                            &nbsp;&nbsp;旅游券编号：<input type="text" id="TravelVo_Id" class="finput1"> 
                            &nbsp;&nbsp;密码：<input type="text" id="pwd" class="finput1">
                            &nbsp;&nbsp;<input type="image" id="Add" src="~/images/fbtn1.png" align="absmiddle">
                        </div>
                        <div class="fly">【温馨提示】旅游券一经充值，将只能在会员本人消费中国梦想游网产品时使用，无法进行转移、赠送、退还等其他操作！</div>
                        <div class="fly"><span class="fspan6"><a href="#">抵用券获得</a> | <a href="#">抵用券消费</a></span></div>
                        <div class="fclist">
                            <table border="0" cellpadding="0" cellspacing="0" width="678">
                                <tr bgcolor="#fff7e5" height="26">
                                    <td width="100" align="center" valign="middle">编号</td>
                                    <td width="100" align="center" valign="middle">面额</td>
                                    <td width="129" align="center" valign="middle">有效期至</td>
                                    <td width="129" align="center" valign="middle">充值时间</td>
                                    <td width="90" align="center" valign="middle">发送密码</td>
                                </tr>
                                @for (int i = 0; i < tourVo.Count; i++)
                                {
                                    <tr height="26" style="color:#f3cc94;">
                                        <td width="100" align="center" valign="middle">@tourVo[i].TravelVo_Id</td>
                                        <td width="100" align="center" valign="middle">@tourVo[i].TravelVo_balance</td>
                                        <td width="159" align="center" valign="middle">@tourVo[i].TravelVoRecord_Effective</td>
                                        <td width="159" align="center" valign="middle">@tourVo[i].TravelVoRecord_CreateTime</td>
                                        <td width="159" align="center" valign="middle">@tourVo[i].TravelVo_CardPwd</td>
                                    </tr>
                                }
                                @*<tr height="26" style="color:#f60; font-weight:bold;">
                                        <td colspan="6" height="35" align="center">目前没有旅游券获得纪录</td>
                                    </tr>*@
                            </table>
                        </div>
                        <div class="fly">
                            尊贵的梦想游会员们，为了您的账户和旅游券安全，从2011年10月25日起中国梦想游游券将和会员账户绑定，
                            已充入账户的旅游券将仅用于当前账户的消费。您仍可用该账户旅游券为亲朋预订产品。
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script>
    $("#Add").click(function () {
        if ($("#TravelVo_Id").val() == "")
        {
            layer.msg('请输入编号！', {
                title: '提示框',
                icon: 1,
                time: 1000
            });
            return;
        }
        if ($("#pwd").val() == "")
        {
            layer.msg('请输入密码！', {
                title: '提示框',
                icon: 1,
                time: 1000
            });
            return;
        }
        var data = {};
        data.User_Id =@user.User_Id;
        data.TravelVo_Id = $("#TravelVo_Id").val();
        data.TravelVo_CardPwd  = $("#pwd").val();
        $.ajax({
            url: "/User/TourVoRecharge",
            type: "post",
            data: data,
            success: function (result) {
                if (result.Success) {
                    layer.msg(result.msg, {
                        title: '提示框',
                        icon: 1,
                        time: 2000
                    }, function () {
                        location.reload(true);
                    });
                }
                else {
                    layer.msg(result.msg, {
                        title: '提示框',
                        icon: 1,
                        time: 2000
                    });
                }
            }
        });
    });
</script>
</html>

